<template>
  <div class="" style="height: 100%">
    <beijingdatatable :header="header" :datalist="datalist" />
  </div>
</template>
<script>
import data from "../data";

export default {
  name: "datatablebeijingreyuan",
  components: {},
  data() {
    return {
      header: [],
      datalist: [],
    };
  },
  computed: {},
  watch: {
    "$store.state.daping.queryDbreyuan": {
      handler: function (n, o) {
        this.loadData(n);
      },
    },
  },
  mounted() {},
  methods: {
    loadData(n) {
      this.header = data.header;
      let aaa = [];
      for (let index = 0; index < n.length; index++) {
        let item = n[index]
        aaa.push([
          item.name,
          item['m_001t'] ? item['m_001t'] : '-',
          item['m_002t'] ? item['m_002t'] : '-',
          item['m_001p'] ? item['m_001p'] : '-',
          item['m_002p'] ? item['m_002p'] : '-',
          item['m_003q'] ? item['m_003q'] : '-',
          item['m_003qc'] ? item['m_003qc'] : '-',
          item['m_006qc'] ? item['m_006qc'] : '-',
        ]);
      }
      this.datalist = aaa;
    },
  },
};
</script>
<style lang='scss' scoped>
</style>